<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<% request.setCharacterEncoding("GBK") ;%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<!--  打开单一的案件  -->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<style>
.dynamic{
float:left
}
.case_information{
float:right
}
</style>
<meta http-equiv="Content-Type" content="text/html; charset=GBK" />
<title>InterLaw</title>
</head>
<script type="text/javascript" src="js/jquery-1.8.3.js"></script>
<script>
var time;
var time;
/********************
* 取窗口滚动条高度 
******************/
function getScrollTop()
{
    var scrollTop=0;
    if(document.documentElement&&document.documentElement.scrollTop)
    {
        scrollTop=document.documentElement.scrollTop;
    }
    else if(document.body)
    {
        scrollTop=document.body.scrollTop;
    }
    return scrollTop;
}
/********************
* 取窗口可视范围的高度 
*******************/
function getClientHeight()
{
    var clientHeight=0;
    if(document.body.clientHeight&&document.documentElement.clientHeight)
    {
        var clientHeight = (document.body.clientHeight<document.documentElement.clientHeight)?document.body.clientHeight:document.documentElement.clientHeight;        
    }
    else
    {
        var clientHeight = (document.body.clientHeight>document.documentElement.clientHeight)?document.body.clientHeight:document.documentElement.clientHeight;    
    }
    return clientHeight;
}
/********************
* 取文档内容实际高度 
*******************/
function getScrollHeight()
{
    return Math.max(document.body.scrollHeight,document.documentElement.scrollHeight);
}

	$(document)
			.ready(
					function() {
					$("#moredynamic").click(function(){
					var number = document.getElementById("index").value;
					document.getElementById("index").setAttribute("value",parseInt(number)+10);
					//number = parseInt(number)+5;
					//alert(number);	
					//document.getElementById("index").setAttribute("value",number.toString());
					//document.form.submit();	
	  $.ajax({  //提交ajax数据
type: "POST",
url:"jumptomoredynamicsinglecase.action",	//把表单数据发送到ajax.jsp
data:{
"index":number,
"case_id":document.getElementById("case_id").value
},
async: true,
error: function(request) {
alert("登录请求失败，请重试");
},
success: function(data) {
var clientLength = $(".content").length;
$(".content").eq(clientLength-1).before(data);
time=1;
//alert(time);
}
}); 
 	document.getElementById("moredynamic").style.display = "none"; 
					})
var agent = navigator.userAgent;
if (/.*Firefox.*/.test(agent)) {
    document.addEventListener("DOMMouseScroll", function(e) {
     var wheelDelta = e.wheelDelta;
       if (getScrollTop()+getClientHeight()==getScrollHeight()&&time==1){
			 if (wheelDelta > 0) {
           // alert("鼠标向上滚动");
       		 } else {
        	time=0;       	
        	$("#moredynamic").click();
         	  //alert("鼠标向下滚动");
        	}
 		}
    });
} else {
    document.onmousewheel = function(e) {
      //  e = e; 
      var wheelDelta = e.wheelDelta;
       if (getScrollTop()+getClientHeight()==getScrollHeight()&&time==1){
			 if (wheelDelta > 0) {
           // alert("鼠标向上滚动");
       		 } else {
        	time=0;       	
        	$("#moredynamic").click();
         	  //alert("鼠标向下滚动");
        	}
 		}
    }
}
					});
</script>
 <div class="dynamic">
 <table border="0" width="500" style="width: 500px;">	
		<tr><td><a>动态</a></td></tr>		
		<hr>
		<tr> <td><a>我的案件</a><%="&nbsp;&nbsp;&nbsp;&nbsp;"%><a>关注的案件</a><%="&nbsp;&nbsp;&nbsp;&nbsp;"%><a>动态</a> </td> </tr>	
		 <s:iterator value="content" status="status">
   		 <s:iterator value="top" id="inner" status="status_in">
   		 <s:if test="%{#status_in.index==0}">
		    	<tr><td><font size="6" face="arial" color="red"><s:property value="#inner"/></font></td></tr>		
    	 </s:if> 	 
    	  <s:else>
    		 	<tr>
				<td>
				<font><s:property value="#inner"/></font>
				</td>
				</tr>	
				<s:iterator value="content_para" status="status2">
				<s:if test="%{#status2.index==#status.index}">     			
				 <s:iterator value="top" id="inner2" status="status2_in"> 
       			<s:if test="%{#status2_in.index==#status_in.index}">
       			<tr><td><font><%="&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"%>
       			<s:property value="#inner2"/></font></td></tr>		
       			</s:if>
       			</s:iterator>
       			</s:if>
   		 		</s:iterator> 
    		 </s:else>  
   		 </s:iterator>
   		 </s:iterator>
   		 <tr class="content"><td> <%="&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"%>
   		 <input  type="button" value="︾更多案件动态"id="moredynamic"></input></td></tr>	 
   		 <tr><td><input type="hidden" value="<s:property value='index'/>" id="index" name="index"></input></td></tr>
   		 <tr><td><input type="hidden" value="<s:property value='case_id'/>" id="case_id" name="case_id"></input></td></tr>
		</table>
</div>
<div class="case_information">
<a>案件信息 <%="&nbsp;&nbsp;&nbsp;&nbsp;"%>立案信息</a>
<a onclick="alert('立案信息表')">(点击查看立案信息表)</a>
 <hr><br>
 <a><img src="images/logo_02.png" ><font><s:property value="case_name"/></font></a>
</div>
<noframes>
	<body>您的浏览器不支持框架！</body>
</noframes>
</html>